/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f6fa;
}

/* 导航栏样式 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 40px;
}

.logo span {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #3498db;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: #f5f6fa;
    border-radius: 20px;
    padding: 5px 15px;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    padding: 5px;
    width: 200px;
}

.search-box button {
    border: none;
    background: none;
    cursor: pointer;
    color: #7f8c8d;
}

.user-actions {
    display: flex;
    gap: 10px;
}

.login-btn, .register-btn {
    padding: 8px 20px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.login-btn {
    background-color: transparent;
    color: #3498db;
    border: 1px solid #3498db;
}

.register-btn {
    background-color: #3498db;
    color: white;
}

/* 主要内容区域样式 */
main {
    margin-top: 70px;
    padding: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* 轮播图样式 */
.hero-slider {
    position: relative;
    height: 300px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 40px;
    width: 100%;
    background-color: #f0f0f0;
}

.slider-container {
    height: 100%;
    width: 100%;
    position: relative;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background-color: #f0f0f0;
}

.slide-content {
    position: absolute;
    bottom: 30px;
    left: 30px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    max-width: 50%;
    z-index: 2;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 8px;
}

.slide-content h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.slide-content p {
    font-size: 16px;
    margin-bottom: 15px;
}

.cta-button {
    padding: 12px 30px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.dot.active {
    background-color: white;
}

/* 功能导航区样式 */
.feature-nav {
    margin-bottom: 40px;
}

.feature-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.feature-item {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item i {
    font-size: 36px;
    color: #3498db;
    margin-bottom: 15px;
}

.feature-item h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.feature-item p {
    color: #7f8c8d;
}

/* 热门内容区样式 */
.hot-content {
    max-width: 1200px;
    margin: 0 auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.content-tabs {
    display: flex;
    gap: 15px;
}

.tab {
    padding: 8px 20px;
    border: none;
    background: none;
    cursor: pointer;
    color: #7f8c8d;
    font-weight: 500;
}

.tab.active {
    color: #3498db;
    border-bottom: 2px solid #3498db;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.content-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.content-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.card-content p {
    color: #7f8c8d;
    margin-bottom: 15px;
}

.card-meta {
    display: flex;
    gap: 15px;
    color: #95a5a6;
    font-size: 14px;
}

/* 页脚样式 */
.footer {
    background-color: #2c3e50;
    color: white;
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    padding: 0 20px;
}

.footer-section h4 {
    margin-bottom: 20px;
    font-size: 18px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: #bdc3c7;
    font-size: 24px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: #bdc3c7;
}

/* 用户头像和下拉菜单样式 */
.user-profile {
    position: relative;
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 240px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    margin-top: 10px;
    z-index: 1000;
}

.user-avatar:hover .user-dropdown {
    display: block;
}

.dropdown-header {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #eee;
}

.dropdown-header img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.user-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.user-info h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
}

.user-info p {
    margin: 5px 0 0;
    color: #7f8c8d;
    font-size: 14px;
}

.dropdown-menu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #2c3e50;
    text-decoration: none;
    transition: background-color 0.3s;
}

.dropdown-menu li a:hover {
    background-color: #f5f6fa;
}

.dropdown-menu li a i {
    width: 20px;
    color: #7f8c8d;
    text-align: center;
}

/* 模态窗口样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 20px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    border-color: #4a90e2;
    outline: none;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-primary {
    background-color: #4a90e2;
    color: white;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
}

.btn-primary:hover {
    background-color: #357abd;
}

.btn-secondary:hover {
    background-color: #e8e8e8;
}

/* 提示消息样式 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    z-index: 1100;
    animation: slideIn 0.3s ease-out;
}

.message.success {
    background-color: #4caf50;
}

.message.error {
    background-color: #f44336;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}